Detailed description of the JavaScript Date object, javascriptdate
This article describes how to operate Date and Time objects.
Directory1. Introduction: Describes the Date object.
2. constructor: describes several methods of the constructor of the
Dateobjects are the date (time) objects that we often say.DateObjects are primarily used to enable basic storage, retrieval, and calculation of dates and Times.This object is supported by all major Browsers.The genus of the date object
Date ObjectThe Date object is used to process dates and times.To create the syntax for a Date object:var mydate=new Date ();Note: The Date object automatically saves the current date and time as its initial value.1. Date Initialization settings new
This article mainly describes the date and time objects of the operation, the specific contents are as follows
Directory1. Description: Describes the Date object.
2. Constructor: Describes several ways to introduce the constructor of the date
Date ObjectThe Date object is used to process dates and times.To create the syntax for a Date object:var mydate=new Date ()Note: The Date object automatically saves the current date and time as its initial value.Date Object Properties
The syntax for creating a Date object: the var mydate=new date () Date object automatically saves the current date and time to its initial value. Date () Returns the day and time. Get: Gets getdate () returns a day from the Date object for one
JavaScript Date ObjectDate ObjectThe Date object is used to process dates and times.to create the syntax for a Date object:var mydate=new Date ()Note: The Date object automatically saves the current date and time as its initial value.Date Object
Knowledge Points:
is primarily used for date objects. (The following information is from the network)
to create the syntax for a Date object:
var mydate=new Date ()
The Date object automatically saves the current date and time as its initial
Internet search "JS Calendar plugin" will come out of various effects of rich calendar plugin, many can download the source code, and then according to their own needs to modify the source code can be used directly.But today is not about how to use
One, string to Date:1. The string format is: yyyy-mm-dd hh24:mi:ss– using IE kernel browser must be converted to YYYY/MM/DD Hh24:mi:ssvarDatestr= "2015-04-08 14:7:12";//or 2015-4-8 14:7:12var Date = New Date(Date.Parse (datestr.Replace/-/g,'/')));
Date and Time objects1. Introduce Date object that is the object of the action date and time. A Date object can operate on dates and times only through methods.2. Constructor function2.1 New Date (): Returns the current local date and time
Date Object method
Method
Description
Date ()
Returns the date and time of day.
GetDate ()
Returns the day of the one month (1 ~ 31) from the Date object.
GetDay ()
Returns
From: http://www.w3school.com.cn/js/jsref_obj_date.asp
A good JS website,
The date object is an internal data type of JavaScript.
The date object does not have any attribute that can be read and written directly. All accesses to the date and time
This article mainly introduces the operation of date and time objects.
1. Introduce
1.1 Description
Date object that is the object of the action date and time. A Date object can operate on dates and times only through methods.
1.2 Properties
The date function of JS is very powerful. Usually used.First get the current date:var curdate = new Date (), var year = Curdate.getfullyear (); Year (four-digit example:) var Month = Curdate.getmonth () +1; Month 0~11var day = Curdate.getdate ();
Original: JavaScript Date Object IntroductionDate and Time object 1. IntroducedA Date object that is the object that operates on the date and time. The Date object operates on dates and times only through methods.2. Constructor 2.1 new Date ():
Date and Time object 1. IntroducedA Date object that is the object that operates on the date and time. The Date object operates on dates and times only through methods.2. Constructor 2.1 new Date (): Returns the current local date and timeParameters:
Original: JavaScript Date ObjectDate and Time object 1. IntroducedA Date object that is the object that operates on the date and time. The Date object operates on dates and times only through methods.2. Constructor 2.1 new Date (): Returns the
To create the syntax for a Date object:
Copy Code code as follows:
The Date object automatically saves the current date and time as its initial value.
New Date ();
value-millisecond: Represents the value that began 00:00:00
It is mainly used for Date objects. First, let's recall the parameters and methods of the Date object. The Code is as follows. If you are interested, refer
Knowledge point:
It is mainly used for Date objects. (The following content is from the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.